#ifndef CC_SORT_TIMER_H
#define CC_SORT_TIMER_H

/****	Public header file	*/
#include "./cc_type.h"

/****	define */

#define STIMER_TYP_PERIOD		0x00	// 默认是周期计数
#define STIMER_TYP_ONCE 		0x01

#define CFG_SORT_TIMER	// 软定时机制
#ifdef 	CFG_SORT_TIMER
typedef struct CC_Sort_Timer tSTimer;

extern void STimer_Show(tSTimer* pObj);
extern int STimer_BindCBF(tSTimer* pObj, int (*pFunc)(void*) );
extern int STimer_BindPara(tSTimer* pObj, void* pPara );
extern int STimer_OnOff(tSTimer* pObj, uint8_t OnOff);


typedef struct CC_Sort_Timer_Management tSTimerMgm;
// extern void STimerMgm_Show(tSTimerMgm* pObj);
// extern tSTimerMgm* STimerMgm_Create(void);
// extern int STimerMgm_MsTick_CallBack(tSTimerMgm* pObj);
// extern tSTimer* STimerMgm_CreateAndAdd(tSTimerMgm* pObj,uint8_t Id,uint8_t TimerTyp,tMs msTick);
// extern int STimerMgm_RemoveAndDestory(tSTimerMgm* pObj, tSTimer* pTimer);

#endif


#define CFG_APP_SORT_TIMER	// 为方便使用 封装
#ifdef 	CFG_APP_SORT_TIMER 

extern int SortTimer_Init(void);
extern tSTimer* STimer_CreateAndAdd(uint8_t Id,uint8_t TimerTyp,tMs msTick);
extern int STimer_RemoveAndDestory(tSTimer* pTimer);
extern int STimer_Run(void);
extern void STimerX_Show(void);

#endif

#endif